#!/usr/bin/python

"""
Author:			Jimmy Saw
Date modified:	06-18-2012

Description:    This script can convert Fasta formatted multiple-sequence
                alignment files into Phylip format

Usage:          dissertation_ConvertAlignment.py <in file> <in format> <outfile> <outformat>

Example:        dissertation_ConvertAlignment.py test.fasta fasta test.phy phylip

Note:           writable formats: fasta, phylip, clustal, stockholm
                readable formats: fasta, phylip, clustal, stockholm, emboss, ig, nexus
"""

import sys
import re
from Bio import AlignIO

alnfile = sys.argv[1]

alnformat = sys.argv[2]

outfile = sys.argv[3]

outformat = sys.argv[4]

AlignIO.convert(alnfile, alnformat, outfile, outformat)
